<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>管理人员修改</title>
<link rel="stylesheet" type="text/css" href="../../Res/LayUI/css/layui.css" media="all">
<style type="text/css">
	body{
		margin:20px 0px;
	}
</style>
</head>
<body>
	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>修改管理人员</legend>
	</fieldset>

	<form class="layui-form" action="../../food/update" method="post" enctype="multipart/form-data">
		<div class="layui-input-inline">
			<input type="hidden" name="foodId" id="foodId" required
				lay-verify="required" placeholder="菜品ID" autocomplete="off"
				class="layui-input">
		</div>
			<div class="layui-inline">
				<label class="layui-form-label">食品类型</label>
				<div class="layui-input-inline">
					<select class="typefoodname" name="foodTypeId" id="foodTypeId">
						<option>请选择食品类型</option>
					</select>
				</div>
			</div>
			
			<div class="layui-inline">
				<label class="layui-form-label">食品名称</label>
				<div class="layui-input-inline">
					<input type="text" name="foodName" id="foodName" 
						lay-verify="" placeholder="食品名称" maxlength="18"
						autocomplete="off" class="layui-input">
				</div>
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">食品价格</label>
				<div class="layui-input-inline">
					<input type="number" name="foodPrice" id="foodPrice" 
						lay-verify="" placeholder="食品价格" autocomplete="off"
						class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">食品简介</label>
				<div class="layui-input-inline">
					<input type="text" name="foodIntro" id="foodIntro" 
						lay-verify="" placeholder="食品简介" autocomplete="off"
						class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">食品销量</label>
				<div class="layui-input-inline">
					<input type="text" name="foodQuantity" id="foodQuantity" 
						lay-verify="" placeholder="食品销量" autocomplete="off"
						class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">食品图片</label>
				<div class="layui-input-inline">
					<input type="file" name="pic" id="pic" 
						lay-verify="" placeholder="食品图片" autocomplete="off"
						class="layui-input">
				</div>
			</div>
			
			<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">是否有效</label>
				<div class="layui-input-inline">
					<select class="input-xlarge" name="isva" id="isva">
						<option value="2">有效</option>
						<option value="1">无效</option>
					</select>
				</div>
			</div>
			
		
			<div class="laayui-inline">
				<div class="layui-input-inline">
					<input type="hidden" name="role" id="r" 
						lay-verify="" placeholder="" autocomplete="off"
						class="layui-input">
				</div>
			</div>
		</div>
		
		
		<div class="layui-form-item" style="margin:10px 0px;">
			<div class="layui-input-block">
				<input type="submit" class="layui-btn" lay-submit=""
					lay-filter="update" value="立即修改">
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
	<script src="../../Res/LayUI/layui.js" charset="utf-8"></script>
	<script type="text/javascript">
		layui.use('form', function(){
			  var form = layui.form
			  ,layer = layui.layer
			  ,$ = layui.$;
			  var url = "../../foodtype/selecttypeAll";
			  $.ajax({
				  url:url,
				  data:null,
				  success:function(data){
					  for(var i=0;i<data.length;i++){
						  $("#foodTypeId").append("<option value='"+data[i].foodTypeId+"'>"+data[i].foodTypeName+"</option>");					
						  form.render();
					  }
				  },
				  dataType:"JSON"
			  }); 
			  
			  form.on('submit(update)',function(){
				  parent.location.reload(); // 父页面刷新
			  });
			});
	</script>
</body>
</html>